package com.ljx.funchat.chat.dao;

import com.ljx.funchat.chat.domain.entity.RedbagRecord;
import com.ljx.funchat.chat.mapper.RedbagRecordMapper;
import com.ljx.funchat.chat.service.IRedbagRecordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 抢红包记录表 服务实现类
 * </p>
 *
 * @author LiJunXi
 * @since 2024-02-18
 */
@Service
public class RedbagRecordDao extends ServiceImpl<RedbagRecordMapper, RedbagRecord> {

    public Integer countByUidAndRedbagId(Long uid, Long redbagId) {
        return lambdaQuery().eq(RedbagRecord::getRedbagId, redbagId)
                .eq(RedbagRecord::getUid, uid)
                .count();
    }
}
